package com.future.account.client;

import com.alibaba.fastjson.JSONObject;
import com.future.account.client.hystrix.EmailClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 邮件发送客户端
 *
 * @author shiyong
 * 2022/2/19 16:53
 */
@FeignClient(
        contextId = "emailClient",
        name = "email-service",
        path = "/email",
        fallback = EmailClientFallback.class)
public interface EmailClient {
    /**
     * 发送邮件
     *
     * @param email 邮件地址
     * @param content 邮件内容
     * @return com.alibaba.fastjson.JSONObject
     * @author shiyong
     * 2022/2/19 19:21
    */
    @PostMapping("/sendEmail")
    JSONObject sendEmail(@RequestParam String email, @RequestParam String content);
}
